namespace utils {

#ifdef HAVE_STL_WSTRING
	inline std::wstring toWideString(std::string const& sValue) {

		typedef std::ctype<wchar_t> CT;

		std::wstring wsResult;
		wsResult.resize( sValue.length() + 1 );

		CT const& oCt = std::use_facet<CT>(std::locale());
		oCt.widen(&sValue[0], &sValue[0] + sValue.size(), &wsResult[0]);

		return wsResult;
	}
#endif
	
	#define NANOSECONDS_PER_SECOND 1000000000

	inline void xtSleepMsec(unsigned long nMsec) {
		boost::this_thread::sleep(boost::posix_time::milliseconds(nMsec));
	}

	inline void xtSleepSec(unsigned int nSec) {
		boost::this_thread::sleep<boost::posix_time::seconds>(boost::posix_time::seconds(nSec));
	}


	template<typename T>
	inline bool isClass(const std::type_info& oSrcTypeInfo) {
		if(std::string (oSrcTypeInfo.name()) == std::string(typeid(T).name())) {
			return true;
		}
		else
			return false;
	}
}
